package zy1208.zy19;

import java.lang.reflect.Constructor;

public class demo {
    public static void main(String[] args) {

    }
    public Object newInstance (String className, Object[] args) throws Exception{
        Class<?> aClass = Class.forName(className);
        Constructor<?> c = aClass.getDeclaredConstructor(String.class);
        Object o = c.newInstance(args);
        return o;
    }
}
